package com.hldsmart.smartda.activity.mine;


import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.LinearLayout;

import com.hldsmart.smartda.R;
import com.hldsmart.smartda.activity.home.FootprintActivity;
import com.hldsmart.smartda.base.BaseActivity;
import com.hldsmart.smartda.commonutils.widget.CustomDialog;

import butterknife.Bind;
import butterknife.ButterKnife;

import static com.hldsmart.smartda.activity.mine.AccountActivity.startAccountActivity;
import static com.hldsmart.smartda.activity.mine.GeneralActivity.startGeneralActivity;
import static com.hldsmart.smartda.activity.mine.PersonActivity.startPersonActivity;

public class SettingActivity extends BaseActivity implements View.OnClickListener {


    @Bind(R.id.iv_setting_back)
    ImageView iv_setting_back;
    @Bind(R.id.ll_myperson)
    LinearLayout ll_myperson;
    @Bind(R.id.ll_general)
    LinearLayout ll_general;
    @Bind(R.id.ll_myAccount)
    LinearLayout ll_myAccount;
    @Bind(R.id.bt_exit)
    Button bt_exit;

    public static void startSettingActivity(Context context) {
        Intent intent = new Intent(context, SettingActivity.class);
        context.startActivity(intent);
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_setting);
        ButterKnife.bind(this);
        setListener();
    }

    private void setListener(){
        iv_setting_back.setOnClickListener(this);
        ll_myperson.setOnClickListener(this);
        ll_general.setOnClickListener(this);
        ll_myAccount.setOnClickListener(this);
        bt_exit.setOnClickListener(this);

    }

    @Override
    public void onClick(View v) {
        switch (v.getId()){
            case R.id.iv_setting_back:
                finish();
                break;
            case R.id.ll_myperson:
                startPersonActivity(this);
                break;
            case R.id.ll_myAccount:
                startAccountActivity(this);
                break;
            case R.id.ll_general:
                startGeneralActivity(this);
                break;
            case R.id.bt_exit:
                CustomDialog.Builder builder = new CustomDialog.Builder(SettingActivity.this);
                builder.setTitle(R.string.prompt);
                builder.setMessage(R.string.exit_app);
                builder.setPositiveButton(R.string.confirm, null);
                builder.setNegativeButton(R.string.cancel, null);
                builder.create().show();
                break;
        }

    }
}
